import java.util.Scanner;

public class Main {
    /*public static int max2(int x,int y) {
        return x>y?x:y;
    }

    public static int max3(int x,int y,int z) {
        return max2(max2(x,y),z);
    }
    public static void main(String[] args) {
        int x=9;
        int y=3;
        int z=11;
        System.out.println(max3(x,y,z));
    }*/
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int x = scanner.nextInt();
        int sum = 0;
        int sum1 = 1;
        for (int i = 1; i <= x; i++) {
            sum1 = 1;
            for (int j = 1; j <= i; j++) {
                sum1 *= j;
            }
            sum += sum1;
        }
        System.out.println(sum);

    }
}